package com.hlz.fastnote

import android.content.ClipData
import android.content.ClipboardManager
import android.content.Context


object Utils {

    fun copy(text:String?){
        val clipboardManager: ClipboardManager = App.app.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
        //创建ClipData对象
        val clipData = ClipData.newPlainText("simple text copy", text)
        //添加ClipData对象到剪切板中
        clipboardManager.setPrimaryClip(clipData)
    }
}